using System;
using System.Collections.Generic;
using Anagram;
using NUnit.Framework;


namespace TestAnagrams {

    [TestFixture]
    public class TestAnagram {

        [Test]
        public void InitialisesWithEmptyBaseString_WhenObjectIsCreated()
        {
            //Arrange
            Anagrams testee = new Anagrams("");

            //Act

            //Assert
            Assert.AreEqual("", testee.baseStringForCreatingAnagrams);
        }


        [Test]
        public void InitialisesWithBiroBaseString_WhenObjectIsCreated()
        {
            //Arrange
            Anagrams testee = new Anagrams("biro");

            //Act

            //Assert
            Assert.AreEqual("biro", testee.baseStringForCreatingAnagrams);
        }

        [Test]
        public void ReturnsNoAnagram_WhenStringIsEmpty()
        {
            //Arrange
            Anagrams testee = new Anagrams("");
            List<string> listOfAnagrams = new List<string>();

            //Act
            

            //Assert
            Assert.True(testee.listOfAnagrams.Count == 0);
        }

        [Test]
        public void ReturnsBaseStringAsAnagram_WhenStringIsOnlyOneCharacter()
        {
            //Arrange
            Anagrams testee = new Anagrams("A");
            List<string> listOfAnagrams = new List<string>();
            listOfAnagrams.Add("A");

            //Act
            

            //Assert
            Assert.AreEqual(listOfAnagrams,testee.listOfAnagrams);
        }

        [Test]
        public void ReturnsAnagrams_WhenStringIsMoreThanOneCharacter()
        {
            //Arrange
            Anagrams testee = new Anagrams("AB");
            List<string> listOfAnagrams = new List<string>();
            listOfAnagrams.Add("AB");
            listOfAnagrams.Add("BA");

            //Act


            //Assert
            Assert.AreEqual(listOfAnagrams, testee.listOfAnagrams);
        }
    }
}
